<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <%@include file="/view/resource.jsp" %>
	<!-- Js Start -->
	<script type="text/javascript">
	 var editor1=null;
		KindEditor.ready(function(K) {
			editor1 = K.create('textarea[name="new_content"]', {
				cssPath : '../plugins/code/prettify.css',
				uploadJson : '../jsp/upload_json.jsp',
				fileManagerJson : '../jsp/file_manager_json.jsp',
				allowFileManager : true
			});
			prettyPrint();
		});
		function test(){
			var html=editor1.html();
			alert(html);
		} 
	</script>
<script type="text/javascript">
YY.plateMain = function(){
	var _box = null;
	var _this = {
		openAddRole:function(record){
			$("#plate_id").combobox('clear'); //清空选择框
			$(".selectId").attr('checked',false); //checkbox 取消选中
			_box.handler.edit(function(result){
				$.each(result.data.roleIds,function(i,roleId){
					$("#selectId_"+roleId).attr("checked", true);
				});
			});
		},
		config:{
  			dataGrid:{
  				title:'新闻列表',
	   			url:'dataList.do',
	   			columns:[[
						{field:'id',checkbox:true},
						{field:'new_title',title:'标题'},
						{field:'plate_name',title:'类型名称'},
						{field:'new_content',title:'内容'}
				]]
			}
		},
		init:function(){
			_box = new YDataGrid(_this.config); 
			_box.init();
		}
	}
	return _this;
}();

$(function(){
	YY.plateMain.init();
});		
</script>
  </head>
  <body class="easyui-layout">
	 <!-- Search panel start -->
 	 <div class="ui-search-panel" region="north" style="height: 50px;" title="" data-options="striped: true,collapsible:false,iconCls:'icon-search',border:false" >  
 	 <form id="searchForm">
 	 	<p class="ui-fields"> 
 	 		
            <label class="ui-label">新闻标题:</label>
            <input name="new_title" class="easyui-box ui-text" style="width:100px;">
        </p>
        <a href="#" id="btn-search" class="easyui-linkbutton" iconCls="icon-search">查询</a>
      </form>  
     </div> 
     <!--  Search panel end -->
     
     <!-- Data List -->
     <div region="center" border="false" >
     <table id="data-list"></table>
     </div>
     
     
     <!-- Edit Win&Form -->
<div id="edit-win" class="easyui-dialog" title="新闻信息" data-options="closed:true,iconCls:'icon-save',modal:true" style="width:900px;height:600px;">  
 	<form id="editForm" class="ui-form" method="post">  
 		  <div class="ui-edit">
 		  <div class="ftitle"></div>    
         <div class="fitem">  
         <input class="hidden" name="id">
 	 		 <input name="new_id" class="hidden">
             <label>新闻标题:</label>  
             <input class="easyui-validatebox" style="width: 400px;" type="text" name="new_title" data-options="required:true">
             <label>板块类型:</label>  
             <select class="easyui-combobox" id="plate_id" name="plate_id" 
             data-options="url:'${msUrl}/portal/dataListAll.do',
							valueField:'id',
							textField:'plate_name',
							panelHeight:'auto',width:135,required:true"></select>
			<br>
			<br>
			<table>
				<tr>
					<td> <label>内容:</label> </td>
					<td>
					<center> <textarea name="new_content" cols="100" rows="8" style="width:680px;height:400px;">${new_content }</textarea>
					
					</center></td>
				</tr>
			</table>
            
           
             
         </div>  
      </div>
 	</form>
</div>
   
  </body>
</html>
